home *** CD-ROM | disk | FTP | other *** search
- #include "bake.h"
-
- surface expensive2 (float Ka = 1, Kd = 0.5, Ks = 0.5, roughness = 0.1;
- color specularcolor = 1;
- string bakename = "bake")
- {
- color myfunc (float s, t) {
- return color noise (s, t);
- }
-
- color Ct;
- BAKE (bakename, s, t, myfunc, Ct);
-
- normal Nf = faceforward (normalize(N),I);
- Ci = Ct * (Ka*ambient() + Kd*diffuse(Nf)) +
- specularcolor * Ks*specular(Nf,-normalize(I),roughness);
- Oi = Os; Ci *= Oi;
- }
-